package net.lab1024.sa.ai.stream.module.business.ai.service.impl;

import net.lab1024.sa.ai.stream.module.business.ai.entity.AiRoleEntity;
import net.lab1024.sa.ai.stream.module.business.ai.mapper.AiRoleMapper;
import net.lab1024.sa.ai.stream.module.business.ai.service.AiRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class AiRoleServiceImpl implements AiRoleService {
    @Autowired
    private AiRoleMapper aiRoleMapper;

    @Override
    public void add(AiRoleEntity entity) {
        aiRoleMapper.insert(entity);
    }

    @Override
    public void update(AiRoleEntity entity) {
        aiRoleMapper.updateById(entity);
    }

    @Override
    public void delete(Long id) {
        aiRoleMapper.deleteById(id);
    }

    @Override
    public AiRoleEntity getById(Long id) {
        return aiRoleMapper.selectById(id);
    }

    @Override
    public List<AiRoleEntity> listAll() {
        return aiRoleMapper.selectList(null);
    }
} 